/*
 *  Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 *  This source code is licensed under the MIT license found in the LICENSE
 *  file in the root directory of this source tree.
 *
 */

/*
 *  THIS FILE IS AUTOGENERATED. DO NOT MODIFY IT; ALL CHANGES WILL BE LOST IN
 *  VAIN.
 *
 *  @generated
 */
#pragma once

#include <memory>
#include <string>
#include <utility>

#include <folly/Optional.h>
#include <folly/io/IOBuf.h>
#include <mcrouter/lib/carbon/CarbonProtocolReader.h>
#include <mcrouter/lib/carbon/CommonSerializationTraits.h>
#include <mcrouter/lib/carbon/Keys.h>
#include <mcrouter/lib/carbon/ReplyCommon.h>
#include <mcrouter/lib/carbon/RequestCommon.h>
#include <mcrouter/lib/carbon/RequestReplyUtil.h>
#include <mcrouter/lib/carbon/Result.h>
#include <mcrouter/lib/carbon/TypeList.h>
#include <mcrouter/lib/carbon/Variant.h>

#include "mcrouter/lib/carbon/test/gen/gen-cpp2/CarbonThriftTest_types.h"

#include "mcrouter/lib/network/gen/CommonMessages.h"

namespace carbon {
namespace test {

using MyEnum = carbon::test::thrift::MyEnum;

std::string enumMyEnumToString(MyEnum val);

using TestUnionThrift = carbon::test::thrift::TestUnionThrift;

using TinyStruct = carbon::test::thrift::TinyStruct;

using MyBaseStruct = carbon::test::thrift::MyBaseStruct;

using MySimpleStruct = carbon::test::thrift::MySimpleStruct;

class ThriftTestReply;

class ThriftTestRequest : public carbon::RequestCommon, public carbon::test::thrift::ThriftTestRequest {
 public:
  using reply_type = ThriftTestReply;

  static constexpr size_t typeId = 67;
  static constexpr const char* name = "test";

  ThriftTestRequest() = default;
  ThriftTestRequest(const ThriftTestRequest&) = default;
  ThriftTestRequest& operator=(const ThriftTestRequest&) = default;
  ThriftTestRequest(ThriftTestRequest&&) = default;
  ThriftTestRequest& operator=(ThriftTestRequest&&) = default;
  explicit ThriftTestRequest(folly::StringPiece sp) {
    key_ref() = sp;
  }
  explicit ThriftTestRequest(folly::IOBuf&& carbonKey) {
    key_ref() = std::move(carbonKey);
  }

  friend class apache::thrift::Cpp2Ops<ThriftTestRequest>;

};

class ThriftTestReply : public carbon::ReplyCommon, public carbon::test::thrift::ThriftTestReply {
 public:

  static constexpr size_t typeId = 68;

  ThriftTestReply() = default;
  ThriftTestReply(const ThriftTestReply&) = default;
  ThriftTestReply& operator=(const ThriftTestReply&) = default;
  ThriftTestReply(ThriftTestReply&&) = default;
  ThriftTestReply& operator=(ThriftTestReply&&) = default;
  explicit ThriftTestReply(carbon::Result carbonResult) {
    result_ref() = carbonResult;
  }

  friend class apache::thrift::Cpp2Ops<ThriftTestReply>;

};

class DummyThriftReply;

class DummyThriftRequest : public carbon::RequestCommon, public carbon::test::thrift::DummyThriftRequest {
 public:
  using reply_type = DummyThriftReply;

  static constexpr size_t typeId = 65;
  static constexpr const char* name = "thrift_test";

  DummyThriftRequest() = default;
  DummyThriftRequest(const DummyThriftRequest&) = default;
  DummyThriftRequest& operator=(const DummyThriftRequest&) = default;
  DummyThriftRequest(DummyThriftRequest&&) = default;
  DummyThriftRequest& operator=(DummyThriftRequest&&) = default;
  explicit DummyThriftRequest(folly::StringPiece sp) {
    key_ref() = sp;
  }
  explicit DummyThriftRequest(folly::IOBuf&& carbonKey) {
    key_ref() = std::move(carbonKey);
  }

  friend class apache::thrift::Cpp2Ops<DummyThriftRequest>;

};

class DummyThriftReply : public carbon::ReplyCommon, public carbon::test::thrift::DummyThriftReply {
 public:

  static constexpr size_t typeId = 66;

  DummyThriftReply() = default;
  DummyThriftReply(const DummyThriftReply&) = default;
  DummyThriftReply& operator=(const DummyThriftReply&) = default;
  DummyThriftReply(DummyThriftReply&&) = default;
  DummyThriftReply& operator=(DummyThriftReply&&) = default;
  explicit DummyThriftReply(carbon::Result carbonResult) {
    result_ref() = carbonResult;
  }

  friend class apache::thrift::Cpp2Ops<DummyThriftReply>;

};

class CustomReply;

class CustomRequest : public carbon::RequestCommon, public carbon::test::thrift::CustomRequest {
 public:
  using reply_type = CustomReply;

  static constexpr size_t typeId = 69;
  static constexpr const char* name = "customRequest";

  CustomRequest() = default;
  CustomRequest(const CustomRequest&) = default;
  CustomRequest& operator=(const CustomRequest&) = default;
  CustomRequest(CustomRequest&&) = default;
  CustomRequest& operator=(CustomRequest&&) = default;
  explicit CustomRequest(folly::StringPiece sp) {
    key_ref() = sp;
  }
  explicit CustomRequest(folly::IOBuf&& carbonKey) {
    key_ref() = std::move(carbonKey);
  }

  friend class apache::thrift::Cpp2Ops<CustomRequest>;

};

class CustomReply : public carbon::ReplyCommon, public carbon::test::thrift::CustomReply {
 public:

  static constexpr size_t typeId = 70;

  CustomReply() = default;
  CustomReply(const CustomReply&) = default;
  CustomReply& operator=(const CustomReply&) = default;
  CustomReply(CustomReply&&) = default;
  CustomReply& operator=(CustomReply&&) = default;
  explicit CustomReply(carbon::Result carbonResult) {
    result_ref() = carbonResult;
  }

  friend class apache::thrift::Cpp2Ops<CustomReply>;

};
} // namespace test
} // namespace carbon

#include "CarbonThriftTestMessages-inl.h"
